<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>q Statement</title>
    <link rel="stylesheet" type="text/css" href="csound.css" />
    <meta name="generator" content="DocBook XSL Stylesheets V1.78.1" />
    <link rel="home" href="index.html" title="The Canonical Csound Reference Manual" />
    <link rel="up" href="ScoregensTop.html" title="Score Statements and GEN Routines" />
    <link rel="prev" href="n.html" title="n Statement" />
    <link rel="next" href="r.html" title="r Statement (Repeat Statement)" />
  </head>
  <body>
    <div class="navheader">
      <table width="100%" summary="Navigation header">
        <tr>
          <th colspan="3" align="center">q Statement</th>
        </tr>
        <tr>
          <td width="20%" align="left"><a accesskey="p" href="n.html">Prev</a> </td>
          <th width="60%" align="center">Score Statements and GEN Routines</th>
          <td width="20%" align="right"> <a accesskey="n" href="r.html">Next</a></td>
        </tr>
      </table>
      <hr />
    </div>
    <div class="refentry">
      <a id="q"></a>
      <div class="titlepage"></div>
      <a id="IndexQStatement" class="indexterm"></a>
      <div class="refnamediv">
        <h2>
          <span class="refentrytitle">q Statement</span>
        </h2>
        <p>q statement — 
      This statement may be used to quiet an instrument.
    </p>
      </div>
      <div class="refsect1">
        <a id="idp212682192"></a>
        <h2>Description</h2>
        <p>
      This statement may be used to quiet an instrument.
    </p>
      </div>
      <div class="refsect1">
        <a id="idp212755584"></a>
        <h2>Syntax</h2>
        <pre class="synopsis"><span class="command"><strong>q</strong></span> p1  p2  p3</pre>
      </div>
      <div class="refsect1">
        <a id="idp212757568"></a>
        <h2>Performance</h2>
        <p>
       <span class="emphasis"><em>p1</em></span> -- Instrument number to mute/unmute.
    </p>
        <p>
       <span class="emphasis"><em>p2</em></span> -- Action time in beats.
    </p>
        <p>
       <span class="emphasis"><em>p3</em></span> -- determines whether the instrument is muted/unmuted. The value of 0 means the instrument is muted, other values mean it is unmuted.
    </p>
        <p>
      Note that this does not affect instruments that are already running at time <span class="emphasis"><em>p2</em></span>. It blocks any attempt to start one afterwards.
    </p>
      </div>
      <div class="refsect1">
        <a id="idp212761824"></a>
        <h2>Examples</h2>
        <p>
      Here is an example of the q statement. It uses the file <a class="ulink" href="examples/q.csd" target="_top"><em class="citetitle">q.csd</em></a>.
      </p>
        <div class="example">
          <a id="idp212763680"></a>
          <p class="title">
            <strong>Example 1081. Example of the q statement.</strong>
          </p>
          <div class="example-contents">
            <pre class="programlisting">
<span class="csdtag">&lt;CsoundSynthesizer&gt;</span>
<span class="csdtag">&lt;CsOptions&gt;</span>
<span class="comment">; Select audio/midi flags here according to platform</span>
-odac     <span class="comment">;;;realtime audio out</span>
<span class="comment">;-iadc    ;;;uncomment -iadc if RT audio input is needed too</span>
<span class="comment">; For Non-realtime ouput leave only the line below:</span>
<span class="comment">; -o q.wav -W ;;; for file output any platform</span>
<span class="csdtag">&lt;/CsOptions&gt;</span>
<span class="csdtag">&lt;CsInstruments&gt;</span>

<span class="ohdr">sr</span> <span class="op">=</span> 44100
<span class="ohdr">ksmps</span> <span class="op">=</span> 32
<span class="ohdr">nchnls</span> <span class="op">=</span> 2
<span class="ohdr">0dbfs</span>  <span class="op">=</span> 1

<span class="oblock">instr</span> 1

aenv <span class="opc">expseg</span> .01, p3<span class="op">*</span>0.25, 1, p3<span class="op">*</span>0.75, 0.01
asig <span class="opc">poscil3</span> .8<span class="op">*</span>aenv, p4, 1
     <span class="opc">outs</span> asig, asig

<span class="oblock">endin</span>
<span class="csdtag">&lt;/CsInstruments&gt;</span>
<span class="csdtag">&lt;CsScore&gt;</span>
<span class="stamnt">f</span> 1 0 16384 10 1<span class="comment">;sine wave</span>
<span class="stamnt">s</span>
<span class="stamnt">q</span> 1 6 0		<span class="comment">;mute at 6 seconds in this section</span>
<span class="stamnt">i</span> 1 0 2 110
<span class="stamnt">i</span> 1 3 2 220
<span class="stamnt">i</span> 1 6 2 440
<span class="stamnt">i</span> 1 9 2 880

<span class="stamnt">s</span>
<span class="stamnt">q</span> 1 6 1		<span class="comment">;unmute again at 6 seconds in this section</span>
<span class="stamnt">i</span> 1 0 2 110
<span class="stamnt">i</span> 1 3 2 220
<span class="stamnt">i</span> 1 6 2 440
<span class="stamnt">i</span> 1 9 2 880
<span class="stamnt">e</span>
<span class="csdtag">&lt;/CsScore&gt;</span>
<span class="csdtag">&lt;/CsoundSynthesizer&gt;</span>
</pre>
          </div>
        </div>
        <p><br class="example-break" />
    </p>
      </div>
    </div>
    <div class="navfooter">
      <hr />
      <table width="100%" summary="Navigation footer">
        <tr>
          <td width="40%" align="left"><a accesskey="p" href="n.html">Prev</a> </td>
          <td width="20%" align="center">
            <a accesskey="u" href="ScoregensTop.html">Up</a>
          </td>
          <td width="40%" align="right"> <a accesskey="n" href="r.html">Next</a></td>
        </tr>
        <tr>
          <td width="40%" align="left" valign="top">n Statement </td>
          <td width="20%" align="center">
            <a accesskey="h" href="index.html">Home</a>
          </td>
          <td width="40%" align="right" valign="top"> r Statement (Repeat Statement)</td>
        </tr>
      </table>
    </div>
  </body>
</html>
